<% layout('/layouts/default.html', {title: '通关缴税查询', libs: ['validate','fileupload','dataGrid']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header with-border">
			<div class="box-title">
				<i class="fa icon-note"></i> ${text('通关缴税详情')}
				<% if (hasPermi('financial:taxclearance:taxClearance:dsdlf')){ %>
				<button type="button" class="btn btn-primary" id="dlf"> ${text('垫税代理费')}</button>
				<% } %>
				<% if (taxClearance.taxPaymentMethod == '1'){ %>
					<% if ((taxClearance.apId == null || taxClearance.arId == null) && hasPermi('financial:taxclearance:taxClearance:dsf')){ %>
						<button type="button" class="btn btn-primary" id="dsdf"> ${text('代收/代付')}</button>
					<% } %>
				<% } else { %>
					<% if (taxClearance.customerActualRepaymentDate == null && hasPermi('financial:taxclearance:taxClearance:khhs')){ %>
					<a href="${ctx}/financial/taxclearance/taxClearance/customerTax?taxClearanceId=${taxClearance.taxClearanceId}" id="khhs"
					   class="btn btn-primary addTabPage" title="${text('客户还税')}"
					   data-layer="true" data-layer-width="400" data-layer-height="400"
					> ${text('客户还税')}</a>
					<% } %>
					<% if (taxClearance.investorActualRepaymentDate == null && hasPermi('financial:taxclearance:taxClearance:zfhs')){ %>
					<a href="${ctx}/financial/taxclearance/taxClearance/investorTax?taxClearanceId=${taxClearance.taxClearanceId}" id="zfhs"
					   class="btn btn-primary addTabPage" title="${text('资方还税')}"
					   data-layer="true" data-layer-width="400" data-layer-height="400"
					> ${text('资方还税')}</a>
					<% } %>
				<% } %>
			</div>
			<div class="box-tools pull-right">
				<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
			</div>
		</div>
		<#form:form id="inputForm" model="${taxClearance}" action="${ctx}/financial/taxclearance/taxClearance/save" method="post" class="form-horizontal">
		<div class="box-body">
			<div class="form-unit">${text('基本信息')}</div>
			<#form:hidden path="taxClearanceId"/>
			<#form:hidden path="arId"/>
			<#form:hidden path="apId"/>
			<div class="row">
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required hide">*</span> ${text('编号')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:input path="taxClearanceCode" maxlength="100" class="form-control" placeholder="自动生成" readonly="true"/>
						</div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required ">*</span> ${text('车架号')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:select path="frameNumber" items="${frameNumberList}"
							itemLabel="frameNumber" itemValue="frameNumber" blankOption="true" class="form-control required" readonly="true"/>
						</div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required ">*</span> ${text('服务订单')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:select path="serviceOrderId" items="${listServiceOrder}"
							itemLabel="serviceOrderCode" itemValue="serviceOrderId" blankOption="true" class="form-control required" readonly="true"/>
						</div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required hide">*</span> ${text('车辆')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:select path="carId" items="${tcarList}" itemLabel="carName" itemValue="carId"
							class="form-control required" blankOption="true" readonly="true"/>
						</div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required hide">*</span> ${text('版型')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:select path="area" dictType="car_quyu" blankOption="true" class="form-control" readonly="true"/>
						</div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required hide">*</span> ${text('报关行')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:select path="customsBroker" items="${customsBrokerList}" itemLabel="supplierName" itemValue="supplierId"
							class="form-control required" blankOption="true" readonly="true"/>
						</div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required hide">*</span> ${text('客户')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:treeselect id="customer" title="${text('客户选择')}"
							path="customer.customerId" labelPath="customer.customerName"
							url="${ctx}/base/customer/customer/treeData" canSelectRoot="true" canSelectParent="true"
							class=" required" allowClear="true"  readonly="true"/>
						</div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required ">*</span> ${text('国内资方')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:select path="investorId" items="${gnzfList}" itemLabel="supplierName" itemValue="supplierId"
							class="form-control required" blankOption="true" readonly="true"/>
						</div>
					</div>
				</div>
                <div class="col-xs-6">
                    <div class="form-group">
                        <label class="control-label col-sm-4" title="">
                            <span class="required ">*</span> ${text('是否资方垫付')}：<i class="fa icon-question hide"></i></label>
                        <div class="col-sm-8">
                            <#form:select path="isinvpad" dictType="sys_yes_no" blankOption="true" class="form-control " readonly="true" disabled="true"/>
                        </div>
                    </div>
                </div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required hide">*</span> ${text('垫付方')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<!--<#form:select path="prepaidId" items="${gnzfList}" itemLabel="supplierName" itemValue="supplierId"
							class="form-control " blankOption="true" readonly="true"/>-->
                            <#form:treeselect id="company" title="${text('公司选择')}"
                            path="company.companyCode" labelPath="company.companyName"
                            url="${ctx}/sys/company/treeData"
                            btnClass="" class="" allowClear="true" canSelectRoot="true" canSelectParent="true" readonly="true" disabled="true"/>
						</div>
					</div>
				</div>
				<div class="col-xs-12">
					<div class="form-group">
						<label class="control-label col-sm-2" title="">
							<span class="required hide">*</span> ${text('备注信息')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-10">
							<#form:textarea path="remarks" rows="4" maxlength="500" class="form-control" readonly="true"/>
						</div>
					</div>
				</div>
			</div>
			<h4 class="form-unit">${text('状态')}</h4>
			<div class="row">
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required hide">*</span> ${text('状态')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:select path="status1" dictType="tax_clearance_status" blankOption="true" class="form-control" readonly="true"/>
						</div>
					</div>
				</div>
			</div>
			<h4 class="form-unit">${text('税金信息')}</h4>
			<div class="row">
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required hide">*</span> ${text('申报价格')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:input path="declaredPrice" class="form-control number" readonly="true"/>
						</div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required hide">*</span> ${text('出税价格')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:input path="taxPrice" class="form-control number" readonly="true"/>
						</div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required hide">*</span> ${text('差额')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:input path="difference" class="form-control number" readonly="true" dataFormat="number2"/>
						</div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required hide">*</span> ${text('海关综合税率')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:input path="customsCombinedTaxRate" maxlength="10" class="form-control" readonly="true"/>
						</div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required hide">*</span> ${text('综合税金')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:input path="comprehensiveTax" class="form-control number" readonly="true"/>
						</div>
					</div>
				</div>
			</div>
			<h4 class="form-unit">${text('垫税信息-缴税信息')}</h4>
			<div class="row">
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required hide">*</span> ${text('外币价格')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:input path="foreignCurrencyPrice" class="form-control number" readonly="true"/>
						</div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required hide">*</span> ${text('海关汇率')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:input path="customsExchangeRate" maxlength="10" class="form-control" readonly="true"/>
						</div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required hide">*</span> ${text('币种')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:select path="currency" dictType="sys_bizhong" blankOption="true" class="form-control" readonly="true"/>
						</div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required ">*</span> ${text('缴税方式')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:select path="taxPaymentMethod" dictType="tax_payment_method" class="form-control required"
							blankOption="true" readonly="true"/>
						</div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required hide">*</span> ${text('缴税截止日期')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:input path="taxPaymentDeadline" readonly="true" maxlength="20" class="form-control"
							dataFormat="date" data-type="date" data-format="yyyy-MM-dd"/>
						</div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required hide">*</span> ${text('资方垫税方案')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:select path="padTaxMode" itemLabel="name" itemValue="id"
							class="form-control" blankOption="true" readonly="true"/>
						</div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required hide">*</span> ${text('出税日期')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:input path="taxDate" readonly="true" maxlength="20" class="form-control"
							dataFormat="date" data-type="date" data-format="yyyy-MM-dd"/>
						</div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required ">*</span> ${text('缴税日期')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:input path="taxPaymentDate" readonly="true" maxlength="20" class="form-control required"
							dataFormat="date" data-type="date" data-format="yyyy-MM-dd"/>
						</div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required hide">*</span> ${text('代垫金额')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:input path="prepaidAmount" class="form-control number" readonly="true" dataFormat="number2"/>
						</div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required hide">*</span> ${text('代收代付金额')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:input path="amount" class="form-control number" readonly="true" dataFormat="number2"/>
						</div>
					</div>
				</div>
				<div class="col-xs-12">
					<div class="form-group">
						<label class="control-label col-sm-2" title="">
							<span class="required hide">*</span> ${text('垫税说明')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-10">
							<#form:textarea path="padTaxMemo" rows="4" maxlength="255" class="form-control" readonly="true"/>
						</div>
					</div>
				</div>
			</div>
			<h4 class="form-unit">${text('垫税信息-资方')}</h4>
			<div class="ml10 mr10">
				<table id="taxClearanceDetailDataGrid1"></table>
			</div>
			<div class="row">
				<div class="col-xs-12">
					<div class="form-group">
						<label class="control-label col-sm-2" title="">
							<span class="required hide">*</span> ${text('延期说明')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-10">
							<#form:textarea path="delayMemo" rows="4" maxlength="255" class="form-control" readonly="true"/>
						</div>
					</div>
				</div>
			</div>
			<h4 class="form-unit">${text('垫税信息-客户')}</h4>
			<div class="ml10 mr10">
				<table id="taxClearanceDetailDataGrid2"></table>
			</div>
			<h4 class="form-unit">${text('还税日期-资方')}</h4>
			<div class="row">
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required hide">*</span> ${text('实际还款日期')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:input path="investorActualRepaymentDate" readonly="true" maxlength="20" class="form-control"
							dataFormat="date" data-type="date" data-format="yyyy-MM-dd"/>
						</div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required hide">*</span> ${text('实际天数')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:input path="investorActualDays" class="form-control digits" readonly="true"/>
						</div>
					</div>
				</div>
<!--				<div class="col-xs-6">-->
<!--					<div class="form-group">-->
<!--						<label class="control-label col-sm-4" title="">-->
<!--							<span class="required hide">*</span> ${text('付款实时利息')}：<i class="fa icon-question hide"></i></label>-->
<!--						<div class="col-sm-8">-->
<!--							<#form:input path="investorRealTimeInterest" class="form-control number" readonly="true" dataFormat="number2"/>-->
<!--						</div>-->
<!--					</div>-->
<!--				</div>-->
<!--				<div class="col-xs-6">-->
<!--					<div class="form-group">-->
<!--						<label class="control-label col-sm-4" title="">-->
<!--							<span class="required hide">*</span> ${text('付款实际利息')}：<i class="fa icon-question hide"></i></label>-->
<!--						<div class="col-sm-8">-->
<!--							<#form:input path="investorActualInterest" class="form-control number" readonly="true"/>-->
<!--						</div>-->
<!--					</div>-->
<!--				</div>-->
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required hide">*</span> ${text('垫税利息')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:input path="investorPadTaxInterest" class="form-control number" readonly="true"/>
						</div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required hide">*</span> ${text('垫税延期利息')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:input path="investorPadTaxYqInterest" class="form-control number" readonly="true"/>
						</div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required hide">*</span> ${text('预付单')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:select path="prepaymentId"  items="${listPrepayment}" itemLabel="prepaymentCode"
							itemValue="prepaymentId" blankOption="true" class="form-control " readonly="true"/>
						</div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required hide">*</span> ${text('还税应付单')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:select path="apId"  items="${listAp}" itemLabel="apCode"
							itemValue="apId" blankOption="true" class="form-control " readonly="true"/>
						</div>
					</div>
				</div>
			</div>
			<h4 class="form-unit">${text('还税日期-客户')}</h4>
			<div class="row">
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required hide">*</span> ${text('实际还款日期')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:input path="customerActualRepaymentDate" readonly="true" maxlength="20" class="form-control"
							dataFormat="date" data-type="date" data-format="yyyy-MM-dd"/>
						</div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required hide">*</span> ${text('实际天数')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:input path="customerActualDays" class="form-control digits" readonly="true"/>
						</div>
					</div>
				</div>
<!--				<div class="col-xs-6">-->
<!--					<div class="form-group">-->
<!--						<label class="control-label col-sm-4" title="">-->
<!--							<span class="required hide">*</span> ${text('收款实时利息')}：<i class="fa icon-question hide"></i></label>-->
<!--						<div class="col-sm-8">-->
<!--							<#form:input path="customerRealTimeInterest" class="form-control number" readonly="true" dataFormat="number2"/>-->
<!--						</div>-->
<!--					</div>-->
<!--				</div>-->
<!--				<div class="col-xs-6">-->
<!--					<div class="form-group">-->
<!--						<label class="control-label col-sm-4" title="">-->
<!--							<span class="required hide">*</span> ${text('收款实际利息')}：<i class="fa icon-question hide"></i></label>-->
<!--						<div class="col-sm-8">-->
<!--							<#form:input path="customerActualInterest" class="form-control number" readonly="true"/>-->
<!--						</div>-->
<!--					</div>-->
<!--				</div>-->
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required hide">*</span> ${text('垫税利息')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:input path="customerPadTaxInterest" class="form-control number" readonly="true"/>
						</div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required hide">*</span> ${text('垫税延期利息')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:input path="customerPadTaxYqInterest" class="form-control number" readonly="true"/>
						</div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required hide">*</span> ${text('预收单')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:select path="advancesReceivedId"  items="${listAdvancesReceived}" itemLabel="advancesReceivedCode"
							itemValue="advancesReceivedId" blankOption="true" class="form-control " readonly="true"/>
						</div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required hide">*</span> ${text('还税应收单')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:select path="arId"  items="${listAr}" itemLabel="arCode"
							itemValue="arId" blankOption="true" class="form-control " readonly="true"/>
						</div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-xs-12">
					<div class="form-group">
						<label class="control-label col-sm-2">
							<span class="required hide">*</span> ${text('图片上传')}：</label>
						<div class="col-sm-10">
							<#form:fileupload id="uploadImage" bizKey="${taxClearance.id}" bizType="taxClearance_image"
							uploadType="image" class="" readonly="false" preview="true"/>
						</div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-xs-12">
					<div class="form-group">
						<label class="control-label col-sm-2">
							<span class="required hide">*</span> ${text('附件上传')}：</label>
						<div class="col-sm-10">
							<#form:fileupload id="uploadFile" bizKey="${taxClearance.id}" bizType="taxClearance_file"
							uploadType="all" class="" readonly="false" preview="true"/>
						</div>
					</div>
				</div>
			</div>
			<h4 class="form-unit">${text('系统信息')}</h4>
			<div class="row">
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required hide">*</span> ${text('创建者')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:input path="createBy" maxlength="64" class="form-control" readonly="true"/>
						</div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required hide">*</span> ${text('创建时间')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:input path="createDate" readonly="true" maxlength="20" class="form-control "
							dataFormat="date" data-type="date" data-format="yyyy-MM-dd"/>
						</div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required hide">*</span> ${text('更新者')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:input path="updateBy" maxlength="64" class="form-control" readonly="true"/>
						</div>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="">
							<span class="required hide">*</span> ${text('更新时间')}：<i class="fa icon-question hide"></i></label>
						<div class="col-sm-8">
							<#form:input path="updateDate" readonly="true" maxlength="20" class="form-control"
							dataFormat="date" data-type="date" data-format="yyyy-MM-dd"/>
						</div>
					</div>
				</div>
			</div>
			<div class="form-unit">${text('相关财务记录')}</div>
			<div class="ml10 mr10">
				<table id="taxClearanceDetailDataGrid3"></table>
			</div>
		</div>
			<div class="box-footer">
				<div class="row">
					<div class="col-sm-offset-2 col-sm-10">
						<button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="js.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> ${text('关 闭')}</button>
					</div>
				</div>
			</div>
		</#form:form>
	</div>
</div>
<% } %>
<script>
	//初始化通关缴税明细DataGrid对象
	$("#taxClearanceDetailDataGrid1").dataGrid({

		data: ${toJson(taxClearance.taxClearanceDetailList1)},
		datatype: "local", // 设置本地数据
		autoGridHeight: function(){return 'auto'}, // 设置自动高度

		// 设置数据表格列
		columnModel: [
			{header:'状态', name:'status', editable:true, hidden:true},
			{header:'类型', name:'type', editable:true, hidden:true},
			{header:'主键', name:'taxClearanceDetailId', editable:true, hidden:true},
			{header:'${text("开始天数")}', name:'startDays', width:150, editable:true, edittype:'text', editoptions:{'class':'form-control digits','readonly':'true'}},
			{header:'${text("结束天数")}', name:'endDays', width:150, editable:true, edittype:'text', editoptions:{'class':'form-control digits','readonly':'true'}},
			{header:'${text("开始日期")}', name:'startDate', width:150,
				formatter:'date', formatoptions:{srcformat:'Y-m-d H:i:s',newformat:'Y-m-d'},
				editable:true, edittype:'text', editoptions:{'class':'form-control', 'readonly':'true',
					dataInit: function(element){
						laydate.render({elem:element, type:'date', format:'yyyy-MM-dd'});
					}
				}
			},
			{header:'${text("结束日期")}', name:'endDate', width:150,
				formatter:'date', formatoptions:{srcformat:'Y-m-d H:i:s',newformat:'Y-m-d'},
				editable:true, edittype:'text', editoptions:{'class':'form-control', 'readonly':'true',
					dataInit: function(element){
						laydate.render({elem:element, type:'date', format:'yyyy-MM-dd'});
					}
				}
			},
			{header:'${text("保证金比例")}', name:'marginRatio', width:150, editable:true, edittype:'text', editoptions:{'class':'form-control number','readonly':'true'}},
			{header:'${text("保证金金额")}', name:'marginAmount', width:150, editable:true, edittype:'text', editoptions:{'class':'form-control number','readonly':'true'}},
			{header:'${text("利率")}', name:'interestRate', width:150, editable:true, edittype:'text', editoptions:{'maxlength':'10', 'class':'form-control','readonly':'true'}},
			{header:'${text("利息")}', name:'interest', width:150, editable:true, edittype:'text', editoptions:{'class':'form-control number'},formatter:'number', formatoptions:{thousandsSeparator:',', decimalPlaces:2, defaulValue:''}},
			{header:'${text("备注")}', name:'remark', width:150, editable:true, edittype:'text', editoptions:{'maxlength':'255', 'class':'form-control','readonly':'true'}},
			{header:'${text("通关缴税ID")}', name:'taxClearanceId.taxClearanceId', editable:true, hidden:true},
			{header:'${text("预付单ID")}', name:'prepaymentId', editable:true, hidden:true},
			{header:'${text("操作")}', name:'actions', width:80, sortable:false, fixed:true, formatter: function(val, obj, row, act){
					var actions = [];
					<% if (hasPermi('financial:taxclearance:taxClearance:bzjyf')){ %>
					if(row.prepaymentId == null){
						actions.push('<a href="#" onclick="bzjyf(\''+obj.rowId+'\')">保证金预付</a>&nbsp;');
					}
			<% } %>
					return actions.join('');
				}, editoptions: {defaultValue: 'new'}}
		],

		// 编辑表格参数
		editGrid: false,				// 是否是编辑表格
		editGridInitRowNum: 0,		// 编辑表格的初始化新增行数
		editGridAddRowInitData: {taxClearanceDetailId: '', status: Global.STATUS_NORMAL},	// 新增行的时候初始化的数据

		// 编辑表格的提交数据参数
		editGridInputFormListName: 'taxClearanceDetailList1', // 提交的数据列表名
		editGridInputFormListAttrs: 'status,taxClearanceDetailId,startDays,endDays,startDate,endDate,marginAmount,interestRate,interest,remark,type,taxClearanceId.taxClearanceId,', // 提交数据列表的属性字段

		// 加载成功后执行事件
		ajaxSuccess: function(data){

		}
	});

	//初始化通关缴税明细DataGrid对象
	$("#taxClearanceDetailDataGrid2").dataGrid({

		data: ${toJson(taxClearance.taxClearanceDetailList2)},
		datatype: "local", // 设置本地数据
		autoGridHeight: function(){return 'auto'}, // 设置自动高度

		// 设置数据表格列
		columnModel: [
			{header:'状态', name:'status', editable:true, hidden:true},
			{header:'类型', name:'type', editable:true, hidden:true},
			{header:'主键', name:'taxClearanceDetailId', editable:true, hidden:true},
			{header:'${text("开始天数")}', name:'startDays', width:150, editable:true, edittype:'text', editoptions:{'class':'form-control digits','readonly':'true'}},
			{header:'${text("结束天数")}', name:'endDays', width:150, editable:true, edittype:'text', editoptions:{'class':'form-control digits','readonly':'true'}},
			{header:'${text("开始日期")}', name:'startDate', width:150,
				formatter:'date', formatoptions:{srcformat:'Y-m-d H:i:s',newformat:'Y-m-d'},
				editable:true, edittype:'text', editoptions:{'class':'form-control', 'readonly':'true',
					dataInit: function(element){
						laydate.render({elem:element, type:'date', format:'yyyy-MM-dd'});
					}
				}
			},
			{header:'${text("结束日期")}', name:'endDate', width:150,
				formatter:'date', formatoptions:{srcformat:'Y-m-d H:i:s',newformat:'Y-m-d'},
				editable:true, edittype:'text', editoptions:{'class':'form-control', 'readonly':'true',
					dataInit: function(element){
						laydate.render({elem:element, type:'date', format:'yyyy-MM-dd'});
					}
				}
			},
			{header:'${text("保证金比例")}', name:'marginRatio', width:150, editable:true, edittype:'text', editoptions:{'class':'form-control number','readonly':'true'}},
			{header:'${text("保证金金额")}', name:'marginAmount', width:150, editable:true, edittype:'text', editoptions:{'class':'form-control number','readonly':'true'}},
			{header:'${text("利率")}', name:'interestRate', width:150, editable:true, edittype:'text', editoptions:{'maxlength':'10', 'class':'form-control','readonly':'true'}},
			{header:'${text("利息")}', name:'interest', width:150, editable:true, edittype:'text', editoptions:{'class':'form-control number'},formatter:'number', formatoptions:{thousandsSeparator:',', decimalPlaces:2, defaulValue:''}},
			{header:'${text("备注")}', name:'remark', width:150, editable:true, edittype:'text', editoptions:{'maxlength':'255', 'class':'form-control','readonly':'true'}},
			{header:'${text("通关缴税ID")}', name:'taxClearanceId.taxClearanceId', editable:true, hidden:true},
			{header:'${text("预收单ID")}', name:'advancesReceivedId', editable:true, hidden:true},
			{header:'${text("操作")}', name:'actions', width:80, sortable:false, fixed:true, formatter: function(val, obj, row, act){
					var actions = [];
					<% if (hasPermi('financial:taxclearance:taxClearance:bzjys')){ %>
					if(row.advancesReceivedId == null){
						actions.push('<a href="#" onclick="bzjys(\''+obj.rowId+'\')">保证金预收</a>&nbsp;');
					}
			<% } %>
					return actions.join('');
				}, editoptions: {defaultValue: 'new'}}
		],

		// 编辑表格参数
		editGrid: false,				// 是否是编辑表格
		editGridInitRowNum: 0,		// 编辑表格的初始化新增行数
		editGridAddRowInitData: {taxClearanceDetailId: '', status: Global.STATUS_NORMAL},	// 新增行的时候初始化的数据

		// 编辑表格的提交数据参数
		editGridInputFormListName: 'taxClearanceDetailList2', // 提交的数据列表名
		editGridInputFormListAttrs: 'status,taxClearanceDetailId,startDays,endDays,startDate,endDate,marginAmount,interestRate,interest,remark,type,taxClearanceId.taxClearanceId,', // 提交数据列表的属性字段

		// 加载成功后执行事件
		ajaxSuccess: function(data){

		}
	});
	$("#taxClearanceDetailDataGrid3").dataGrid({

		data: ${toJson(taxClearance.relatedRecordList)},
		datatype: "local", // 设置本地数据
		autoGridHeight: function(){return 'auto'}, // 设置自动高度

		// 设置数据表格列
		columnModel: [
			{header:'${text("单据编号")}', name:'billCode', width:300},
			{header:'${text("日期")}', name:'date', width:150, },
			{header:'${text("费用项目")}', name:'expenseItem', width:150, editable:true, edittype:'text'},
			{header:'${text("应收金额")}', name:'yingshouAmount', width:150, editable:true, edittype:'text'},
			{header:'${text("应付金额")}', name:'yingfuAmount', width:150, editable:true, edittype:'text'},
			{header:'${text("预收金额")}', name:'yushouAmount', width:150, editable:true, edittype:'text'},
			{header:'${text("预付金额")}', name:'yufuAmount', width:150, editable:true, edittype:'text'},
		],

		// 编辑表格参数
		editGrid: false,				// 是否是编辑表格

		// 加载成功后执行事件
		ajaxSuccess: function(data){

		}
	});
</script>
<script>
$("#inputForm").validate({
	submitHandler: function(form){
		js.ajaxSubmitForm($(form), function(data){
			js.showMessage(data.message);
			if(data.result == Global.TRUE){
				js.closeCurrentTabPage(function(contentWindow){
					contentWindow.page();
				});
			}
		}, "json");
    }
});
$(function(){
	if("${taxClearance.taxPaymentMethod}"!=null){
		let t = "${taxClearance.taxPaymentMethod}";
		$("#taxPaymentMethod").val(t);
	}
	taxPaymentMethodChange();
	if($("#taxPaymentMethod").val()!=null){
		let p = "${taxClearance.padTaxMode}";
		if(p!=null){
			$("#padTaxMode").val(p);
		}
	}
});
function taxPaymentMethodChange(){
	if($("#taxPaymentMethod").val() != "1"){
		$.ajax({
			type : "post",
			async : false,
			url : "${ctx}/financial/taxclearance/taxClearance/getList",
			data : {
				'supplierId' : $("#investorId").val(),
				'taxPaymentMethod' : $("#taxPaymentMethod").val()
			},
			dataType : "json",
			success : function(msg) {
				$("#padTaxMode").empty();
				if (msg.length > 0) {
					for (let i = 0; i < msg.length; i++) {
						let partId = msg[i].investorFinancialInfoId;
						let partName = msg[i].groupName;
						let option = $("<option>").attr({
							"value" : partId
						}).text(partName);
						$("#padTaxMode").append(option);
					}
					$("#padTaxMode option:first").prop("selected", 'selected');
					$("#padTaxMode").change();
				}
			},
			error : function(json) {
				$.jBox.alert("网络异常！");
			}
		});
	}
}

$("#dsdf").click(function(){
	js.confirm('确认生成代收代付吗？', function(data){
		$.ajax({
			type: "POST",
			async : false,
			url: "${ctx}/financial/taxclearance/taxClearance/dsdf",
			data: {"taxClearanceId": $("#taxClearanceId").val()},
			success: function (data) {
				js.showMessage(data.message);
				location.reload();
			}
		});
	});

});

$("#dlf").click(function(){
	js.confirm('确认生成垫税代理费吗？', function(data){
		$.ajax({
			type: "POST",
			async : false,
			url: "${ctx}/financial/taxclearance/taxClearance/dlf",
			data: {"taxClearanceId": $("#taxClearanceId").val()},
			success: function (data) {
				js.showMessage(data.message);
				location.reload();
			}
		});
	});

});

function bzjyf(rowId) {
	js.confirm('确认生成保证金预付吗？', function(data){
		let id = $("#taxClearanceDetailDataGrid1").jqGrid("getCell",rowId,"taxClearanceDetailId");
		$.ajax({
			type: "POST",
			async : false,
			url: "${ctx}/financial/taxclearance/taxClearance/bzjyf",
			data: {"taxClearanceDetailId": id},
			success: function (data) {
				js.showMessage(data.message);
				location.reload();
			}
		});
	});

}

function bzjys(rowId) {
	js.confirm('确认生成保证金预收吗？', function(data){
		let id = $("#taxClearanceDetailDataGrid2").jqGrid("getCell",rowId,"taxClearanceDetailId");
		$.ajax({
			type: "POST",
			async : false,
			url: "${ctx}/financial/taxclearance/taxClearance/bzjys",
			data: {"taxClearanceDetailId": id},
			success: function (data) {
				js.showMessage(data.message);
				location.reload();
			}
		});
	});

}
</script>
